package com.ny.demo428;

class HomeInsurance extends Insurance {
    private double houseValue;
    private double houseArea;

    public HomeInsurance(double houseValue, double houseArea) {
        this.houseValue = houseValue;
        this.houseArea = houseArea;
    }

    @Override
    public double calculatePremium() {
        double basePremium = houseValue * 0.015;
        if (houseArea > 100) {
            return basePremium * 1.05;
        }
        return basePremium;
    }
}
